import { WeaLocaleProvider } from "ecCom";

const getLabel = WeaLocaleProvider.getLabel;
// 这边style.width是用于设置formitem的宽度而不是每个field的宽度
// 邮件设置->账户设置->编辑的condition
export const emailAcEditCon = {
  conditioninfo: [
    {
      items: [
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountName"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "账户名称",
          labelID: 127547,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountMailAddress"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "邮件地址",
          labelID: 19805,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountId"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "邮箱登录名",
          labelID: 384218,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountPassword"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "邮箱密码",
          labelID: 21895,
          otherParams: { type: "password" },
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["isDefault"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "设置为默认账户",
          labelID: 384219,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
      title: getLabel(1361, "基本信息"),
      defaultshow: true,
    },
    {
      items: [
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["serverType"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "邮件服务器类型",
          labelID: 384227,
          labelcol: 8,
          options: [
            {
              key: "1",
              selected: true,
              showname: "POP3",
            },
            {
              key: "2",
              selected: false,
              showname: "IMAP",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["popServer"],
          fieldcol: 9,
          isQuickSearch: false,
          label: "接收邮件服务器",
          labelID: 384228,
          labelcol: 15,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["getneedSSL"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "SSL",
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },

        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["popServerPort"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "接收端口",
          labelID: 24723,
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|numeric",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["smtpServer"],
          fieldcol: 9,
          isQuickSearch: false,
          label: "发送邮件服务器",
          labelID: 384229,
          labelcol: 15,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["sendneedSSL"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "SSL",
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["smtpServerPort"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "发送端口",
          labelID: 24724,
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|numeric",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["isStartTls"],
          fieldcol: 16,
          fieldoffset: 8,
          isQuickSearch: false,
          label: "",
          otherParams: {
            hideLabel: true,
          },
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["needCheck"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "需要发件认证",
          labelID: 15039,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["needSave"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "保留服务器上的邮件",
          labelID: 19807,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["autoreceive"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "自动接收",
          labelID: 24310,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["receiveScope"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "接收开始时间",
          labelID: 32168,
          labelcol: 8,
          options: [
            {
              key: "1",
              selected: true,
              showname: "最近一个月",
            },
            {
              key: "2",
              selected: false,
              showname: "最近三个月",
            },
            {
              key: "3",
              selected: false,
              showname: "最近半年",
            },
            {
              key: "4",
              selected: false,
              showname: "最近一年",
            },
            {
              key: "5",
              selected: false,
              showname: "全部",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
      title: "服务器信息",
      defaultshow: true,
    },
  ],
};

// 邮件设置->账户设置->新建的基本信息的condition
export const emailAcBaseInfoCon = {
  conditioninfo: [
    {
      items: [
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountName"],
          fieldcol: 17,
          isQuickSearch: false,
          label: "账户名称",
          labelID: 127547,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountMailAddress"],
          fieldcol: 17,
          isQuickSearch: false,
          label: "邮件地址",
          labelID: 19805,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountId"],
          fieldcol: 17,
          isQuickSearch: false,
          label: "邮箱登录名",
          labelID: 384218,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["accountPassword"],
          fieldcol: 17,
          isQuickSearch: false,
          label: "邮箱密码",
          labelID: 21895,
          otherParams: { type: "password" },
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["isDefault"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "设置为默认账户",
          labelID: 384219,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
      title: "基本信息",
      defaultshow: true,
    },
  ],
};

// 邮件设置->账户设置->新建的服务器信息的condition
export const emailAcServerkInfoCon = {
  conditioninfo: [
    {
      items: [
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["serverType"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "邮件服务器类型",
          labelID: 384227,
          labelcol: 8,
          options: [
            {
              key: "1",
              selected: true,
              showname: "POP3",
            },
            {
              key: "2",
              selected: false,
              showname: "IMAP",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["popServer"],
          fieldcol: 9,
          isQuickSearch: false,
          label: "接收邮件服务器",
          labelID: 384228,
          labelcol: 15,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["getneedSSL"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "SSL",
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },

        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["popServerPort"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "接收端口",
          labelID: 24723,
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|numeric",
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["smtpServer"],
          fieldcol: 9,
          isQuickSearch: false,
          label: "发送邮件服务器",
          labelID: 384229,
          labelcol: 15,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["sendneedSSL"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "SSL",
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["smtpServerPort"],
          fieldcol: 12,
          isQuickSearch: false,
          label: "发送端口",
          labelID: 24724,
          labelcol: 12,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|numeric",
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["isStartTls"],
          fieldcol: 16,
          fieldoffset: 8,
          isQuickSearch: false,
          label: "",
          otherParams: {
            hideLabel: true,
          },
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["needCheck"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "需要发件认证",
          labelID: 15039,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["needSave"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "保留服务器上的邮件",
          labelID: 19807,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["autoreceive"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "自动接收",
          labelID: 24310,
          labelcol: 8,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["receiveScope"],
          fieldcol: 16,
          isQuickSearch: false,
          label: "接收开始时间",
          labelID: 32168,
          labelcol: 8,
          options: [
            {
              key: "1",
              selected: true,
              showname: "最近一个月",
            },
            {
              key: "2",
              selected: false,
              showname: "最近三个月",
            },
            {
              key: "3",
              selected: false,
              showname: "最近半年",
            },
            {
              key: "4",
              selected: false,
              showname: "最近一年",
            },
            {
              key: "5",
              selected: false,
              showname: "全部",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
      title: "服务器信息",
      defaultshow: true,
    },
  ],
};

export const emailSignEditCon = {
  conditioninfo: [
    {
      title: "基本信息",
      items: [
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["signName"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "签名",
          labelID: 20148,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["signType"],
          fieldcol: 18,
          isQuickSearch: false,
          key: "RADIO",
          label: "签名类型",
          labelID: 384422,
          labelcol: 6,
          options: [
            {
              key: "0",
              selected: true,
              showname: "文本签名",
            },
            {
              key: "1",
              selected: false,
              showname: "电子签名",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
          detailtype: 3,
        },
        {
          colSpan: 2,
          conditionType: "SWITCH",
          domkey: ["isActive"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "是否默认签名",
          labelID: 384422,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
        {
          colSpan: 2,
          conditionType: "INPUT",
          domkey: ["signDesc"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "说明",
          labelID: 384422,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
      defaultshow: true,
    },
  ],
};

// 邮件设置->黑名单->condition
export const emailBlackListCon = {
  conditioninfo: [
    {
      defaultshow: true,
      items: [
        {
          colSpan: 1,
          conditionType: "INPUT",
          domkey: ["mailAddress"],
          fieldcol: 24,
          isQuickSearch: false,
          label: "",
          labelcol: 0,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          otherParams: {
            hideLabel: true,
          },
          rules: "required|string",
        },
      ],
    },
  ],
};

// 邮件设置->文件夹->condition
export const emailFolderCon = {
  conditioninfo: [
    {
      defaultshow: true,
      items: [
        {
          colSpan: 1,
          conditionType: "INPUT",
          domkey: ["folderName"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "文件夹名称",
          labelID: 19825,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 3,
          rules: "required|string",
        },
      ],
    },
  ],
};

export const emailRuleCon = {
  conditioninfo: [
    {
      defaultshow: true,
      items: [
        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["layout"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "应用账户",
          labelID: 384423,
          labelcol: 6,
          options: [
            {
              key: "2",
              selected: false,
              showname: "内部邮件",
            },
            {
              key: "3",
              selected: false,
              showname: "外部邮件",
            },
          ],
          otherParams: {
            detailtype: 3,
          },
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },

        {
          colSpan: 2,
          conditionType: "SELECT",
          domkey: ["receiveScope"],
          fieldcol: 18,
          isQuickSearch: false,
          label: "",
          otherParams: {
            hideLabel: true,
          },
          labelcol: 6,
          options: [
            {
              key: "1",
              selected: true,
              showname: "所有账户",
            },
            {
              key: "2",
              selected: false,
              showname: "指定账户",
            },
          ],
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },

        {
          browserConditionParam: {
            completeParams: {},
            conditionDataParams: {},
            dataParams: {},
            destDataParams: {},
            hasAddBtn: false,
            hasAdvanceSerach: true,
            hasBorder: false,
            idSeparator: ",",
            isAutoComplete: 1,
            isDetail: 0,
            isMultCheckbox: false,
            isSingle: true,
            pageSize: 10,
            quickSearchName: "",
            replaceDatas: [],
            type: "doccategory",
            viewAttr: 2,
          },
          colSpan: 2,
          conditionType: "BROWSER",
          domkey: ["secId"],
          otherParams: {
            hideLabel: true,
          },
          fieldcol: 18,
          isQuickSearch: false,
          label: "默认导出文档目录",
          labelID: 19947,
          labelcol: 6,
          precision: 0,
          relatekey: "",
          viewAttr: 2,
        },
      ],
    },
  ],
};
